import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Demo')
        ),
        //body内容多抽离出去
        body: LayoutDemo()
      )
    );
  }
  
}

class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: <Widget>[
        Card(
          margin: EdgeInsets.all(10),
          child: Column(
            children: <Widget>[
              AspectRatio(
                aspectRatio: 20/9,
                child: Image.network('https://www.itying.com/images/flutter/1.png', fit:BoxFit.cover),
              ),
              ListTile(
                leading: ClipOval(
                  child: Image.network('https://www.itying.com/images/flutter/1.png', fit:BoxFit.cover, height: 60, width: 60,), 
                ),
                title: Text('XXXXX'),
                subtitle: Text('xxxxx'),
              )
            ], 
          ), 
        ),
        Card(
          margin: EdgeInsets.all(10),
          child: Column(
            children: <Widget>[
              AspectRatio(
                aspectRatio: 20/9,
                child: Image.network('https://www.itying.com/images/flutter/2.png', fit:BoxFit.cover),
              ),
              ListTile(
                leading: ClipOval(
                  child: Image.network('https://www.itying.com/images/flutter/2.png', fit:BoxFit.cover, height: 60, width: 60,), 
                ),
                title: Text('XXXXX'),
                subtitle: Text('xxxxx'),
              )
            ], 
          ), 
        ),
        Card(
          margin: EdgeInsets.all(10),
          child: Column(
            children: <Widget>[
              AspectRatio(
                aspectRatio: 20/9,
                child: Image.network('https://www.itying.com/images/flutter/3.png', fit:BoxFit.cover),
              ),
              ListTile(
                leading: CircleAvatar(
                  backgroundImage: NetworkImage('https://www.itying.com/images/flutter/3.png'),
                ),
                title: Text('XXXXX'),
                subtitle: Text('xxxxx'),
              )
            ], 
          ), 
        )
      ],
    );
  }
  
}